﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Sunny.UI;

namespace project.UI
{
    public partial class FormFindPwd : UIForm
    {
        public FormFindPwd()
        {
            InitializeComponent();
        }

        private void uiButton1_Click(object sender, EventArgs e)
        {
            string id = uiTextBox1.Text;
            string name = uiTextBox3.Text;
            string phone = uiTextBox4.Text;
            string sqlstr = $"select pwd from student where " +
                $"number={id} and "+
                $"name={name} and "+
                $"phone_number={phone} ;";
            string result = (string)SqlHelper.ExecuteScalar(sqlstr);
            if(result != null)
            {
                MessageBox.Show("密码是" + result, "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                MessageBox.Show("找回失败", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);

            }
        }

        private void uiButton2_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
